package com.javabase.study.OOPFistPart;

/**
 * TODO
 * 内容：super关键字的学习和测试
 * 作者:jxx
 * 创建时间：2021/6/16
 */
public class TestSuper {
    public static void main(String[] args){

        ChildClass  ch = new ChildClass();

        ch.f();
    }
}
class FatherClass{
    int value;
    public void f(){
        value = 100;
        System.out.println("fatherClass'value is :" + value);
    }
}
class ChildClass extends FatherClass{
    int value;
    public void f(){
        super.f();// 调用父类父对象的普通方法
        value = 200;
        System.out.println("childClass.value is" + value);
        System.out.println(value);
        System.out.println(this.value);//调用本对象
        System.out.println("父类方法的value属性值为：" + super.value);
    }

}
